#include <iostream>
using namespace std;
class Date
{
	public:
	Date(int year = 1, int month = 1, int day = 1)
 	{
		 _year = year;
		 _month = month;
		 _day = day;
	}
	 bool operator<(const Date& x) const
 {
	 if (_year < x._year)
	 {
		 return true;
	 }
	 else if (_year == x._year && _month < x._month)
	 {
		 return true;
	 }
	 else if (_year == x._year && _month == x._month && _day < x._day)
	 {
		 return true;
	 }

	 return  false;
 }
  bool operator==(const Date& x)const
 {
	 return _year == x._year && _month == x._month && _day == x._day;

 }
  bool operator!=(const Date& x)const
 {
	 return !(*this == x);
 }
  int operator-(const Date& d)const//*
 {
	 Date max = *this;
	 Date min = d;
	 if (*this < d)
	 {
		 max = d;
		 min = *this;
	 }
	 int n = 0;
	 while (min != max)
	 {
		 ++min;
		 ++n;
	 }
	 return n;
 }
  Date& operator++()
 {
	 *this += 1;
	 return *this;
 }
 Date operator++(int)
 {
	 Date tmp = *this;
	 *this += 1;
	 return tmp;
 }
 
 Date& operator+=(int day)
 {

	 _day += day;
	 while (_day > GetMonthDay(_year, _month))
	 {
		 _day -= GetMonthDay(_year, _month);
		 _month++;
		 if (_month == 13)
		 {
			 _month = 1;
			 _year++;
		 }
	 }
	 return *this;
 }
	 int GetMonthDay(int year, int month)
{
	 static int MonthDay[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
	 if (month == 2 && ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0))
	 {
		 return 29;
	 }
	 else
	 {
		 return MonthDay[month];
	 }

}
private:
		int _year;
		int _month;
		int _day;
};
int main() {
    int time1,time2;
    int y1,m1,d1,y2,m2,d2;
    cin>>time1>>time2;
       y1 = time1/10000;
        m1 = time1%10000/100;
        d1 = time1%100;
        y2 = time2/10000;
        m2 = time2%10000/100;
        d2 = time2%100;
        Date D1(y1,m1,d1);
        Date D2(y2,m2,d2);
    int ret=D1-D2;
    cout<<++ret<<endl;

}
